import sqlite3

db_name = 'tb.db'
def create_table(db_name):
    conn = sqlite3.connect("tb.db")
    cu = conn.cursor()
    try:
        create_tb_cmd = '''
        create table IF NOT EXISTS USER
        (NAME TEXT,
        AGE INT,
        SALARY REAL);
        '''
        # 主要就是上面的语句
        conn.execute(create_tb_cmd)
        print("123")

    except:
        print("Create table failed")
        return False
    insert_dt_cmd = '''
    INSERT INTO USER (NAME,AGE,SALARY) VALUES ("Rocky",10,20.1);
    '''
    print("123")

    cu.execute(insert_dt_cmd)
    conn.commit()
    cu.close()

create_table(db_name)